<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
	<ui:composition template="template/template.xhtml">
		<ui:define  name="page-title" >#{messages.novoUtilizador}</ui:define >
		<ui:define  name="center">
			<h:outputText styleClass="title" value="#{messages.novoUtilizador}"/>
        	<p:messages id="messages" autoUpdate="true"/> 
           	<h:panelGrid columns="2">
				<h:outputLabel value="#{messages.tipo}" for="tipo"/>
	 			<p:selectOneMenu id="tipo" value="#{userController.novoUtilizador.perfilUtilizador}" >  
                      	<f:selectItems value="#{userController.perfisUtilizador}" var="perfil" />  
                  	</p:selectOneMenu > 
				
	 			<h:outputLabel value="#{messages.username}" for="username"/>
	 			<p:inputText id="username" value="#{userController.novoUtilizador.username}" required="true"/>
	 		
	 			<h:outputLabel value="#{messages.nome}" for="name"/>
	 			<p:inputText id="name" value="#{userController.novoUtilizador.nome}" required="true"/>
	 		
				<h:outputLabel for="nif" value="#{messages.nif}" /> 
          			<p:inputText id="nif" value="#{userController.novoUtilizador.nif}" required="true"/>
          	
				<h:outputLabel for="bi" value="#{messages.bi}" /> 
          			<p:inputText id="bi" value="#{userController.novoUtilizador.bi}" required="true"/>
        
				<h:outputLabel for="contact" value="#{messages.telefone}" /> 
          			<p:inputText id="contact" value="#{userController.novoUtilizador.telefone}" required="true"/>

				<h:outputLabel for="password" value="#{messages.password}" /> 
				<p:inputText id="password" value="#{userController.novoUtilizador.password}" required="true"/>
			 	
    			<h:column>
    				<p:commandButton value="#{messages.voltar}" action="utilizadores" ajax="false" immediate="true"/> 
    			</h:column>
    			<h:column>
    				<p:commandButton value="#{messages.guardar}" action="#{userController.saveNewUtilizadorAction}"  ajax="false"/> 
    			</h:column>
			</h:panelGrid>  
		</ui:define >
	</ui:composition>
</html>